<template>
	<view>
		<view>
			<view class="goods_list">
				<view class="goods_item" v-for="(item,index) in goods" :key="item.goods_id"
					@click="jumpDetail(item.goods_id)">
					<view class="item_contetn">
						<image
							:src="item.goods_small_logo?item.goods_small_logo:'https://z3.ax1x.com/2021/07/23/WyCuQ0.png'"
							mode="widthFix">
						</image>
						<view class="price">
							<text>￥{{item.goods_price}}</text>
							<text>￥￥{{item.goods_price}}</text>
						</view>
						<view class="name">{{item.goods_name}}</view>
					</view>
				</view>

			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: ['goods'],
		data() {
			return {

			}
		},
		methods: {
			jumpDetail(goodsId) {
				uni.navigateTo({
					url: '../../pages/goods_detail/goods_detail?goodsId=' + goodsId
				})
			}
		}
	}
</script>

<style lang="scss">
	.goods_list {
		display: flex;
		flex-wrap: wrap;
		justify-content: space-between;

		.goods_item {
			width: 50%;

			.item_contetn {
				margin: 10rpx;
				background: #fff;
				padding: 10rpx;
				border-radius: 20rpx;

				image {
					width: 80%;
					display: block;
					margin: auto;
				}

				.price {
					color: $shop-color;
					font-size: 36rpx;
					margin: 10rpx 0 5rpx 0;

					text:nth-child(2) {
						font-size: 26rpx;
						margin-left: 15rpx;
						color: #ccc;
						text-decoration: line-through;
					}
				}

				.name {
					font-size: 28rpx;
					line-height: 50rpx;
					padding: 10rpx;
					height: 90rpx;
					margin-bottom: 10rpx;
					display: -webkit-box;
					overflow: hidden;
					-webkit-box-orient: vertical;
					-webkit-line-clamp: 2;
				}
			}

		}

	}
</style>
